/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 839398
 */
@Entity
@Table(name = "tbl_concepto")
@NamedQueries({
    @NamedQuery(name = "TblConcepto.findAll", query = "SELECT t FROM TblConcepto t"),
    @NamedQuery(name = "TblConcepto.findByIdConcepto", query = "SELECT t FROM TblConcepto t WHERE t.idConcepto = :idConcepto"),
    @NamedQuery(name = "TblConcepto.findByDescripcion", query = "SELECT t FROM TblConcepto t WHERE t.descripcion = :descripcion")})
public class TblConcepto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_concepto")
    private Integer idConcepto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "concepto")
    private List<TblCuota> tblCuotaList;

    public TblConcepto() {
    }

    public TblConcepto(Integer idConcepto) {
        this.idConcepto = idConcepto;
    }

    public TblConcepto(Integer idConcepto, String descripcion) {
        this.idConcepto = idConcepto;
        this.descripcion = descripcion;
    }

    public Integer getIdConcepto() {
        return idConcepto;
    }

    public void setIdConcepto(Integer idConcepto) {
        this.idConcepto = idConcepto;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public List<TblCuota> getTblCuotaList() {
        return tblCuotaList;
    }

    public void setTblCuotaList(List<TblCuota> tblCuotaList) {
        this.tblCuotaList = tblCuotaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idConcepto != null ? idConcepto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblConcepto)) {
            return false;
        }
        TblConcepto other = (TblConcepto) object;
        if ((this.idConcepto == null && other.idConcepto != null) || (this.idConcepto != null && !this.idConcepto.equals(other.idConcepto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + descripcion;
    }
    
}
